package com.gc.business.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gc.common.utils.StringUtils;
import org.springframework.stereotype.Service;
import com.gc.business.mapper.InventorySizePriceMapper;
import com.gc.business.domain.InventorySizePrice;
import com.gc.business.service.IInventorySizePriceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;

/**
 * 库存规格值 服务层实现
 * 
 * @author hruiyan
 * @date 2020-11-10
 */
@Slf4j
@Service
public class InventorySizePriceServiceImpl extends ServiceImpl<InventorySizePriceMapper, InventorySizePrice> implements IInventorySizePriceService {

    @Override
    public List<InventorySizePrice> list(InventorySizePrice inventorySizePrice){
        LambdaQueryWrapper<InventorySizePrice> wrapper = new LambdaQueryWrapper<>();
        if(inventorySizePrice != null){
            if(StringUtils.isNotEmpty(inventorySizePrice.getPriceId())){
                wrapper.eq(InventorySizePrice::getPriceId, inventorySizePrice.getPriceId());
            }
            if(StringUtils.isNotEmpty(inventorySizePrice.getSizeId())){
                wrapper.eq(InventorySizePrice::getSizeId, inventorySizePrice.getSizeId());
            }
            if(StringUtils.isNotEmpty(inventorySizePrice.getPriceInfo())){
                wrapper.like(InventorySizePrice::getPriceInfo, inventorySizePrice.getPriceInfo());
            }
            if(StringUtils.isNotEmpty(inventorySizePrice.getCreateBy())){
                wrapper.like(InventorySizePrice::getCreateBy, inventorySizePrice.getCreateBy());
            }
            if(StringUtils.isNotEmpty(inventorySizePrice.getCreateTime())){
                wrapper.eq(InventorySizePrice::getCreateTime, inventorySizePrice.getCreateTime());
            }
            if(StringUtils.isNotEmpty(inventorySizePrice.getUpdateBy())){
                wrapper.like(InventorySizePrice::getUpdateBy, inventorySizePrice.getUpdateBy());
            }
            if(StringUtils.isNotEmpty(inventorySizePrice.getUpdateTime())){
                wrapper.eq(InventorySizePrice::getUpdateTime, inventorySizePrice.getUpdateTime());
            }
            if(StringUtils.isNotEmpty(inventorySizePrice.getRemark())){
                wrapper.like(InventorySizePrice::getRemark, inventorySizePrice.getRemark());
            }
        }
        return baseMapper.selectList(wrapper);
    }
}
